package com.googlecode.jyoutubeuploader.validator;

import org.apache.commons.lang3.StringUtils;

final class BaseValidationResult implements ValidationResult {

	static final ValidationResult VALID = new BaseValidationResult(true, StringUtils.EMPTY);
	private final boolean valid;
	private final String message;

	private BaseValidationResult(boolean valid, String message) {
		this.valid = valid;
		this.message = message;
	}

	@Override
	public boolean isValid() {
		return valid;
	}

	@Override
	public String getMessage() {
		return message;
	}
	
	static ValidationResult getValidInstance() {
		return VALID;
	}

	static ValidationResult newInvalidInstance(String message) {
		return new BaseValidationResult(false, message);
	}
}
